<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>用户:修改新闻内容页</title>
<link rel="stylesheet" href="https://www.jq22.com/jquery/bootstrap-3.3.4.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/base.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/css/jquery-kq-nav-left.css">
</head>
<script type="text/javascript" src="${pageContext.request.contextPath }/js/jquery-3.6.1.js"></script>
<script type="text/javascript">
	var flag = ${flag};
	if(flag == 2){
		alert("上传的文件只能是jpg或png格式哦,请重新上传！！！");
	}
</script>
<body>
	<div>
		<ul class="breadcrumb">
			<li><a href="#">新闻管理</a></li>
			<li><a href="#">新闻修改</a></li>
		</ul>
		<form action="${pageContext.request.contextPath }/usernewsedit" method="post" role="form">
			<div class="form-group">
				<label for="title">新闻标题</label> <input style="width: 50%"
					type="text" class="form-control" name="title" value="${news.title }">
			</div>
			<div class="form-group">
				<label for="content">新闻内容</label>
				<textarea name="content" style="width: 50%" placeholder="请输入新闻内容" class="form-control"
					rows="3"></textarea>
			</div>
			<div class="form-group">
				<label for="photo">新闻图片</label> 
				<input type="file" style="width: 50%" name="photo" class="form-control"/>
			</div>
			<div class="form-group">
				<label for="newsType">新闻类型</label> 
				<select style="width: 50%" name="news_type" class="form-control">
					<option value="-1">--请选择新闻类型--</option>
					<option value="0">社会新闻</option>
					<option value="1">娱乐新闻</option>
					<option value="2">财经新闻</option>
					<option value="3">科技新闻</option>
					<option value="4">体育新闻</option>
					<option value="5">其他新闻</option>
				</select>
			</div>
			<input type="hidden" name="id" value="${news.id}">
			<button type="submit" class="btn btn-default">提交</button>
		</form>
	</div>
</body>
</html>
